/*
 * @文件描述:继电器控制
 * @版本:
 * @作者:周晨阳
 * @Date:2021-11-19 16:09:26
 */
#include "Relay.h"

#if BOARD_INUSE == WIN32

RELAY_STATE RelayStateList[5] = {0};
/**
 * @brief Get the Relay State 
 * 
 * @param channel 继电器id
 * @return RELAY_STATE 
 */
RELAY_STATE getRelayState(u8 channel)
{
    return RelayStateList[channel];
}
/**
 * @brief Set the Relay 
 * 
 * @param state 继电器状态
 */
void setRelay(u8 channel, RELAY_STATE state)
{

    RelayStateList[channel] = state;
}

/**
 * @brief 重置所有继电器
 * 
 */
void resetRelay(void)
{
    u8 i = 0;
    for (i = 0; i < MY_RELAY_COUNT; i++)
    {
        setRelay(i, RELAY_STATE_OFF);
    }
}
#endif